package statics;

import domain.PlayerClass;
import domain.Resource;

public class Validation {

	public static boolean canMine(Resource r, PlayerClass p){
		short rs = r.getBinairyVal();
		short ps = p.getCanMine();
		
		short logicAnd = (short)(rs & ps);
		
		return rs == logicAnd;
	}
	
	public static int checkValue(int i, boolean incdec){
		if(incdec)
			return i;
		return -i;
	}
	
	public static String mineId(short s){
		switch(s){
			case 1 : return "Wood"; 
			case 2 : return "Stone";
			case 4 : return "Gold";
			case 8 : return "Metal";
			case 16 : return "Artifact";
			case 32 : return "Sulfur";
		}
		return "invalid";
	}
	
	public static String buildingId(short s){
		switch(s){
			case 1 : return ""; 
			case 2 : return "";
			case 4 : return "";
			case 8 : return "";
			case 16 : return "";
			case 32 : return "";
		}
		return "invalid";
	}
	
	
}
